

OBJ=obj
SRC=src
EXE=bin
CPPFLAGS=-c -g
CXX=g++

SRCFILES=
OBJFILES=$(OBJ)/calcPaths.o \
         $(OBJ)/fibonacci.o \
         $(OBJ)/calcAllSubsets.o \
         $(OBJ)/strPermutation.o \
         $(OBJ)/parenthesis.o \
         $(OBJ)/paintFill.o \
         $(OBJ)/coinCombination.o \
         $(OBJ)/queenArrange.o \
         $(OBJ)/queenCount.o \
         $(OBJ)/uniquePath.o

all: testCalcPaths.exe \
     testFibonacci.exe \
     testSubset.exe \
     testPermutation.exe \
     testBracket.exe \
     testPaintFill.exe \
     testCoinComb.exe \
     testQueenArrange.exe \
     testQueenCount.exe \
     testUniquePath.exe \
     install

testCalcPaths.exe : $(OBJ)/testCalcPaths.o $(OBJFILES)
	$(CXX) -o $@ $^

testFibonacci.exe : $(OBJ)/testFibonacci.o $(OBJFILES)
	$(CXX) -o $@ $^

testPermutation.exe : $(OBJ)/testPermutation.o $(OBJFILES)
	$(CXX) -o $@ $^

testSubset.exe : $(OBJ)/testSubset.o $(OBJFILES)
	$(CXX) -o $@ $^

testBracket.exe : $(OBJ)/testBracket.o $(OBJFILES)
	$(CXX) -o $@ $^

testPaintFill.exe : $(OBJ)/testPaintFill.o $(OBJFILES)
	$(CXX) -o $@ $^

testCoinComb.exe : $(OBJ)/testCoinComb.o $(OBJFILES)
	$(CXX) -o $@ $^

testQueenArrange.exe : $(OBJ)/testQueenArrange.o $(OBJFILES)
	$(CXX) -o $@ $^

testQueenCount.exe : $(OBJ)/testQueenCount.o $(OBJFILES)
	$(CXX) -o $@ $^

testUniquePath.exe : $(OBJ)/testUniquePath.o $(OBJFILES)
	$(CXX) -o $@ $^

$(OBJ)/%.o : $(SRC)/%.cpp
	$(CXX) $(CPPFLAGS) -o $@ $<

install:
	mv *.exe $(EXE)/.

clean:
	rm -rf 	$(OBJ)/*.o $(EXE)/*.exe
